package com.sysystem.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sysystem.dao.ISignDao;
import com.sysystem.model.Sign;
import com.sysystem.service.ISignService;

@Service("signServiceImpl")
public class SignServiceImpl implements ISignService {
	
	@Autowired
	private ISignDao signDao;

	@Override
	public List<Sign> selectSignedAllData(String train_cd, int start, int end) {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("TRAIN_CD", train_cd);
		paramMap.put("START", start);
		paramMap.put("END", end);
		
		List<Sign> rs = signDao.selectSignedAllData(paramMap);
		return rs;
	}

	@Override
	public int selectSignedAllDataCount(String train_cd) {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("TRAIN_CD", train_cd);
		int rsCount = signDao.selectSignedAllDataCount(paramMap);
		return rsCount;
	}

	@Override
	public int saveSignData(String train_cd, String wechat_cd) {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("TRAIN_CD", train_cd);
		paramMap.put("WECHAT_CD", wechat_cd);
		int rsCount = signDao.saveSignData(paramMap);
		return rsCount;
	}

}
